# -*- coding: utf-8 -*-
from django.conf.urls import url

from user import views

urlpatterns = [
    #==========================用户管理=====================================
    #   登录
    url(r'^login/', views.LoginView.as_view()),  #用于获取授权认证token
    #   注册
    url('register/$',views.RegisterView.as_view()),  # 用户注册
    #   用户信息管理
    url('user/(?P<pk>.*)/$',
        views.UserView.as_view({'get': 'list','delete': 'destroy', 'put': 'update'})),
    url('user/',
        views.UserView.as_view({'get': 'list'})),
    #===========================师资库======================================
    # 创建单条数据
    url('teacher/(?P<pk>.*)/$',
        views.TeacherView.as_view({'get': 'list','delete': 'destroy', 'put': 'update'})),
    url('teacher/$',views.TeacherView.as_view({'get': 'list',"post":"create",'delete': 'destroy'})),
    # 生成师资模板
    url('download_teacher/$',
        views.DownLoadView.as_view({'post': 'list','delete': 'destroy', 'put': 'update'})),
    # xlsx批量导入教师数据，解析入库
    url('import_teacher/$',
        views.TeacherImportView.as_view({'post': 'getexcel','delete': 'destroy', 'put': 'update'})),
    # 模糊查询
    url('isLike_teacher/$',
         views.TeacherListView.as_view({'get': 'list'})),
    url('export_teacher/$',
        views.ExportView.as_view({'post': 'export'})),
    url('delete_teacher/$',
        views.DeleteView.as_view({'post': 'destroy'})),
    #==========================学员库=======================================
    # 创建单条数据
    url('trainee/(?P<pk>.*)/$',
        views.TraineeView.as_view({'get': 'list', 'delete': 'destroy', 'put': 'update'})),
    url('trainee/', views.TraineeView.as_view({'get': 'list', "post": "create"})),
    url('exportTrainee/$',
        views.ExportTraineeView.as_view({'post': 'export'})),
    # 生成学员模板
    url('downloadTrainee/',
        views.DownLoadTraineeView.as_view({'get': 'list'})),
]
